class ReadFile():
    def __init__(self, filename, size):
        self.filename = filename
        self.size = size
    def read_line_method(self):
        try:
            with open(self.filename, encoding='utf-8') as f:
                for line in f:
                    print(line) 
        except FileNotFoundError:
            print('该文件 ' + self.filename + ' 不存在！')
  
    
    def read_byte_method(self):
        try:
            with open(self.filename, encoding='utf-8') as f:
                while(1):
                    content = f.read(self.size)
                    if not content:
                        break
                    print(content)
        except FileNotFoundError:
            print('该文件 ' + self.filename + ' 不存在！')

    


